//**********************************************************************
//----------------------------------------------------------------------
// Company      : PI2STAR
// File name    : common.h
// Author       : jinxu
// Date         : 2022-11-18 10:54:32
// Revision     : V0.1
// Description  : some functions for writing test-case
//----------------------------------------------------------------------
//**********************************************************************
#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdint.h>
//#include "base_addr.h"

//add write and read func
#define write64(addr,value)   *(volatile unsigned long *)(addr) = value
#define read64(addr)          *(volatile unsigned long *)(addr)

#define write(addr,value)   *(volatile unsigned int *)(addr) = value
#define read(addr)          *(volatile unsigned int *)(addr)

#define write16(addr,value) *(volatile short unsigned int *)(addr) = value
#define read16(addr)        *(volatile short unsigned int *)(addr)

#define write8(addr,data)   *(volatile unsigned char  *)(addr) = data
#define read8(addr)         *(volatile unsigned char  *)(addr)


void delay_nop(int num);

#endif


